package com.shorturi.uri.domains;

import lombok.Builder;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;

import java.io.Serializable;

/**
 * @author sola
 */
@Data
@Builder
@Document(indexName = "uri-index", type = "uri-type", shards = 1, replicas = 0,
        refreshInterval = "-1")
public class UriEntity implements Serializable {

    private @Id
    Long id;

    private String shortUri;

    private String longUri;

    public UriEntity() {
    }

    public UriEntity(Long id, String shortUri, String longUri) {
        this.id = id;
        this.shortUri = shortUri;
        this.longUri = longUri;
    }

    public UriEntity(Long id) {
        this.id = id;
    }
}
